const gulp = require("gulp");

gulp.task("webpack", () => {
  const webpack = require("webpack-stream");
  const config = require("./webpack-config.js");
  gulp
    .src("./js/**/*.js")
    .pipe(webpack(config))
    .pipe(gulp.dest("../www/js"));
});

gulp.task("less", () => {
  const less = require("gulp-less");
  gulp
    .src("./less/*.less")
    .pipe(less())
    .pipe(gulp.dest("../www/css"));
});



gulp.task("watch", () => {
  gulp.watch("less/**/*.less", gulp.parallel("less"));
  gulp.watch("js/**/*.js", gulp.parallel("webpack"));
});


gulp.task("default", gulp.parallel("webpack", "less"))